Optimal. Leaf size=154 \[ \frac {B x}{a^4}-\frac {(6 A-55 B) \sin (c+d x)}{105 a^4 d (1+\cos (c+d x))^2}+\frac {(12 A-215 B) \sin (c+d x)}{105 a^4 d (1+\cos (c+d x))}+\frac {(A-B) \cos ^3(c+d x) \sin (c+d x)}{7 d (a+a \cos (c+d x))^4}+\frac {(3 A-10 B) \cos ^2(c+d x) \sin (c+d x)}{35 a d (a+a \cos (c+d x))^3} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.28, antiderivative size = 154, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 5, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.161, Rules used = {3056, 3047,
3098, 2814, 2727} \begin {gather*} \frac {(12 A-215 B) \sin (c+d x)}{105 a^4 d (\cos (c+d x)+1)}-\frac {(6 A-55 B) \sin (c+d x)}{105 a^4 d (\cos (c+d x)+1)^2}+\frac {B x}{a^4}+\frac {(A-B) \sin (c+d x) \cos ^3(c+d x)}{7 d (a \cos (c+d x)+a)^4}+\frac {(3 A-10 B) \sin (c+d x) \cos ^2(c+d x)}{35 a d (a \cos (c+d x)+a)^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2727
Rule 2814
Rule 3047
Rule 3056
Rule 3098
Rubi steps
\begin {align*} \int \frac {\cos ^3(c+d x) (A+B \cos (c+d x))}{(a+a \cos (c+d x))^4} \, dx &=\frac {(A-B) \cos ^3(c+d x) \sin (c+d x)}{7 d (a+a \cos (c+d x))^4}+\frac {\int \frac {\cos ^2(c+d x) (3 a (A-B)+7 a B \cos (c+d x))}{(a+a \cos (c+d x))^3} \, dx}{7 a^2}\\ &=\frac {(A-B) \cos ^3(c+d x) \sin (c+d x)}{7 d (a+a \cos (c+d x))^4}+\frac {(3 A-10 B) \cos ^2(c+d x) \sin (c+d x)}{35 a d (a+a \cos (c+d x))^3}+\frac {\int \frac {\cos (c+d x) \left (2 a^2 (3 A-10 B)+35 a^2 B \cos (c+d x)\right )}{(a+a \cos (c+d x))^2} \, dx}{35 a^4}\\ &=\frac {(A-B) \cos ^3(c+d x) \sin (c+d x)}{7 d (a+a \cos (c+d x))^4}+\frac {(3 A-10 B) \cos ^2(c+d x) \sin (c+d x)}{35 a d (a+a \cos (c+d x))^3}+\frac {\int \frac {2 a^2 (3 A-10 B) \cos (c+d x)+35 a^2 B \cos ^2(c+d x)}{(a+a \cos (c+d x))^2} \, dx}{35 a^4}\\ &=-\frac {(6 A-55 B) \sin (c+d x)}{105 a^4 d (1+\cos (c+d x))^2}+\frac {(A-B) \cos ^3(c+d x) \sin (c+d x)}{7 d (a+a \cos (c+d x))^4}+\frac {(3 A-10 B) \cos ^2(c+d x) \sin (c+d x)}{35 a d (a+a \cos (c+d x))^3}-\frac {\int \frac {-2 a^3 (6 A-55 B)-105 a^3 B \cos (c+d x)}{a+a \cos (c+d x)} \, dx}{105 a^6}\\ &=\frac {B x}{a^4}-\frac {(6 A-55 B) \sin (c+d x)}{105 a^4 d (1+\cos (c+d x))^2}+\frac {(A-B) \cos ^3(c+d x) \sin (c+d x)}{7 d (a+a \cos (c+d x))^4}+\frac {(3 A-10 B) \cos ^2(c+d x) \sin (c+d x)}{35 a d (a+a \cos (c+d x))^3}+\frac {(12 A-215 B) \int \frac {1}{a+a \cos (c+d x)} \, dx}{105 a^3}\\ &=\frac {B x}{a^4}-\frac {(6 A-55 B) \sin (c+d x)}{105 a^4 d (1+\cos (c+d x))^2}+\frac {(A-B) \cos ^3(c+d x) \sin (c+d x)}{7 d (a+a \cos (c+d x))^4}+\frac {(3 A-10 B) \cos ^2(c+d x) \sin (c+d x)}{35 a d (a+a \cos (c+d x))^3}+\frac {(12 A-215 B) \sin (c+d x)}{105 d \left (a^4+a^4 \cos (c+d x)\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(329\) vs. \(2(154)=308\).
time = 0.80, size = 329, normalized size = 2.14 \begin {gather*} \frac {\sec \left (\frac {c}{2}\right ) \sec ^7\left (\frac {1}{2} (c+d x)\right ) \left (3675 B d x \cos \left (\frac {d x}{2}\right )+3675 B d x \cos \left (c+\frac {d x}{2}\right )+2205 B d x \cos \left (c+\frac {3 d x}{2}\right )+2205 B d x \cos \left (2 c+\frac {3 d x}{2}\right )+735 B d x \cos \left (2 c+\frac {5 d x}{2}\right )+735 B d x \cos \left (3 c+\frac {5 d x}{2}\right )+105 B d x \cos \left (3 c+\frac {7 d x}{2}\right )+105 B d x \cos \left (4 c+\frac {7 d x}{2}\right )+1260 A \sin \left (\frac {d x}{2}\right )-9940 B \sin \left (\frac {d x}{2}\right )-1260 A \sin \left (c+\frac {d x}{2}\right )+8260 B \sin \left (c+\frac {d x}{2}\right )+882 A \sin \left (c+\frac {3 d x}{2}\right )-7140 B \sin \left (c+\frac {3 d x}{2}\right )-630 A \sin \left (2 c+\frac {3 d x}{2}\right )+3780 B \sin \left (2 c+\frac {3 d x}{2}\right )+294 A \sin \left (2 c+\frac {5 d x}{2}\right )-2800 B \sin \left (2 c+\frac {5 d x}{2}\right )-210 A \sin \left (3 c+\frac {5 d x}{2}\right )+840 B \sin \left (3 c+\frac {5 d x}{2}\right )+72 A \sin \left (3 c+\frac {7 d x}{2}\right )-520 B \sin \left (3 c+\frac {7 d x}{2}\right )\right )}{13440 a^4 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.19, size = 130, normalized size = 0.84
method | result | size |
derivativedivides | \(\frac {-\frac {\left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) A}{7}+\frac {\left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) B}{7}+\frac {3 A \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{5}-B \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) A +\frac {11 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) B}{3}+A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-15 B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+16 B \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 d \,a^{4}}\) | \(130\) |
default | \(\frac {-\frac {\left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) A}{7}+\frac {\left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) B}{7}+\frac {3 A \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{5}-B \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) A +\frac {11 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) B}{3}+A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-15 B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+16 B \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 d \,a^{4}}\) | \(130\) |
risch | \(\frac {B x}{a^{4}}+\frac {2 i \left (105 A \,{\mathrm e}^{6 i \left (d x +c \right )}-420 B \,{\mathrm e}^{6 i \left (d x +c \right )}+315 A \,{\mathrm e}^{5 i \left (d x +c \right )}-1890 B \,{\mathrm e}^{5 i \left (d x +c \right )}+630 A \,{\mathrm e}^{4 i \left (d x +c \right )}-4130 B \,{\mathrm e}^{4 i \left (d x +c \right )}+630 A \,{\mathrm e}^{3 i \left (d x +c \right )}-4970 B \,{\mathrm e}^{3 i \left (d x +c \right )}+441 A \,{\mathrm e}^{2 i \left (d x +c \right )}-3570 B \,{\mathrm e}^{2 i \left (d x +c \right )}+147 A \,{\mathrm e}^{i \left (d x +c \right )}-1400 B \,{\mathrm e}^{i \left (d x +c \right )}+36 A -260 B \right )}{105 d \,a^{4} \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )^{7}}\) | \(181\) |
norman | \(\frac {\frac {B x}{a}+\frac {B x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}+\frac {4 B x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}+\frac {6 B x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}+\frac {4 B x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}+\frac {\left (A -15 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{8 d a}+\frac {\left (A -15 B \right ) \left (\tan ^{13}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{280 d a}-\frac {\left (A -B \right ) \left (\tan ^{15}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{56 d a}+\frac {\left (3 A -605 B \right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{840 d a}+\frac {\left (9 A -1465 B \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{280 d a}+\frac {\left (9 A -169 B \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{24 d a}+\frac {\left (39 A -1145 B \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{120 d a}+\frac {\left (57 A +55 B \right ) \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{840 d a}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4} a^{3}}\) | \(298\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.48, size = 201, normalized size = 1.31 \begin {gather*} -\frac {5 \, B {\left (\frac {\frac {315 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {77 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {21 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} - \frac {3 \, \sin \left (d x + c\right )^{7}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{7}}}{a^{4}} - \frac {336 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{4}}\right )} - \frac {3 \, A {\left (\frac {35 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {35 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {21 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} - \frac {5 \, \sin \left (d x + c\right )^{7}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{7}}\right )}}{a^{4}}}{840 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.35, size = 180, normalized size = 1.17 \begin {gather*} \frac {105 \, B d x \cos \left (d x + c\right )^{4} + 420 \, B d x \cos \left (d x + c\right )^{3} + 630 \, B d x \cos \left (d x + c\right )^{2} + 420 \, B d x \cos \left (d x + c\right ) + 105 \, B d x + {\left (4 \, {\left (9 \, A - 65 \, B\right )} \cos \left (d x + c\right )^{3} + {\left (39 \, A - 620 \, B\right )} \cos \left (d x + c\right )^{2} + {\left (24 \, A - 535 \, B\right )} \cos \left (d x + c\right ) + 6 \, A - 160 \, B\right )} \sin \left (d x + c\right )}{105 \, {\left (a^{4} d \cos \left (d x + c\right )^{4} + 4 \, a^{4} d \cos \left (d x + c\right )^{3} + 6 \, a^{4} d \cos \left (d x + c\right )^{2} + 4 \, a^{4} d \cos \left (d x + c\right ) + a^{4} d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 3.62, size = 192, normalized size = 1.25 \begin {gather*} \begin {cases} - \frac {A \tan ^{7}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{56 a^{4} d} + \frac {3 A \tan ^{5}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{40 a^{4} d} - \frac {A \tan ^{3}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{8 a^{4} d} + \frac {A \tan {\left (\frac {c}{2} + \frac {d x}{2} \right )}}{8 a^{4} d} + \frac {B x}{a^{4}} + \frac {B \tan ^{7}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{56 a^{4} d} - \frac {B \tan ^{5}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{8 a^{4} d} + \frac {11 B \tan ^{3}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{24 a^{4} d} - \frac {15 B \tan {\left (\frac {c}{2} + \frac {d x}{2} \right )}}{8 a^{4} d} & \text {for}\: d \neq 0 \\\frac {x \left (A + B \cos {\left (c \right )}\right ) \cos ^{3}{\left (c \right )}}{\left (a \cos {\left (c \right )} + a\right )^{4}} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.43, size = 155, normalized size = 1.01 \begin {gather*} \frac {\frac {840 \, {\left (d x + c\right )} B}{a^{4}} - \frac {15 \, A a^{24} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 15 \, B a^{24} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 63 \, A a^{24} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 105 \, B a^{24} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 105 \, A a^{24} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 385 \, B a^{24} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 105 \, A a^{24} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1575 \, B a^{24} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{28}}}{840 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.34, size = 162, normalized size = 1.05 \begin {gather*} \frac {B\,x}{a^4}+\frac {\left (\frac {12\,A\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{35}-\frac {52\,B\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{21}\right )\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+\left (\frac {16\,B\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{21}-\frac {23\,A\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{70}\right )\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+\left (\frac {9\,A\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{70}-\frac {5\,B\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{28}\right )\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-\frac {A\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{56}+\frac {B\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{56}}{a^4\,d\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________